package com.group.eams.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.eams.pojo.dto.CopyrightQueryDto;
import com.group.eams.pojo.entity.Copyright;
import com.group.eams.pojo.vo.CopyrightBasicVo;
import com.group.eams.pojo.vo.CopyrightListVo;
import com.group.eams.service.CopyrightService;
import com.group.eams.mapper.CopyrightMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 恩哲欣
* @description 针对表【copyright(无形资产(著作权登记表))】的数据库操作Service实现
* @createDate 2024-10-29 16:09:34
*/
@Service
public class CopyrightServiceImpl extends ServiceImpl<CopyrightMapper, Copyright> implements CopyrightService{

    @Autowired
    private CopyrightMapper copyrightMapper;
    /**
     * 分页查询
     *
     * @param copyrightQueryDto
     * @return
     */
    @Override
    public Page<CopyrightListVo> findByQueryDto(CopyrightQueryDto copyrightQueryDto) {
        Page<CopyrightListVo> page = new Page<>(copyrightQueryDto.getPage(), copyrightQueryDto.getLimit());
        return copyrightMapper.findByQueryDto(page,copyrightQueryDto);
    }

    /**
     * 根据id查询基础数据
     *
     * @param id
     * @return
     */
    @Override
    public CopyrightBasicVo findBasicById(Long id) {
        return copyrightMapper.findBasicById(id);
    }
}
